﻿
Namespace LightSwitchApplication

    Public Class InvoiceHeader

        Private Sub InvoiceTotal_Compute(ByRef result As Decimal)
            ' Set result to the desired field value
            

        End Sub

        Private Sub Advance_Compute(ByRef result As Decimal)
            ' Set result to the desired field value
            
        End Sub

        Private Sub PaidAmount_Validate(results As EntityValidationResultsBuilder)
            ' results.AddPropertyError("<Error-Message>")

        End Sub

        Private Sub PaidAmount_Compute(ByRef result As Decimal)
            ' Set result to the desired field value
            Dim res = 0
            For Each InvoiceDetail In InvoiceDetails
                res = res + InvoiceDetail.PaidAmount
            Next
            result = res
        End Sub

        Private Sub NetRemaining_Compute(ByRef result As Decimal)
            ' Set result to the desired field value
           

        End Sub

        Private Sub FromDate_Changed()
            'CalculateInvoice()

        End Sub


        Private Sub ToDate_Changed()
            'CalculateInvoice()

        End Sub

        Private Sub Carrier_Changed()
            'CalculateInvoice()

        End Sub
        
        Private Sub InvoiceTotal_Validate(results As EntityValidationResultsBuilder)
            ' results.AddPropertyError("<Error-Message>")

        End Sub
    End Class

End Namespace
